<%@page import="com.dfhc.bus.carposition.ICarPositionConstants" %>
<%@ page contentType="text/html; charset=UTF-8" language="java"%>
<!--_meta 作为公共模版分离出去-->
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<link rel="Bookmark" href="/favicon.ico" >
<link rel="Shortcut Icon" href="/favicon.ico" />

<!-- 全局js 和css包 -->
<%@ include file="/jsp/include/web/new/global.jsp" %>
<!--/meta 作为公共模版分离出去-->

<link rel="stylesheet" href="<%=request.getContextPath() %>/css/ztree/demo.css" type="text/css">
<link rel="stylesheet" href="<%=request.getContextPath() %>/css/ztree/zTreeStyle/zTreeStyle.css" type="text/css">
<script type="text/javascript" src="<%=request.getContextPath() %>/js/ztree/jquery.ztree.core-3.5.js"></script>
<script type="text/javascript" src="<%=request.getContextPath() %>/js/ztree/jquery.ztree.excheck-3.5.js"></script>

<script type="text/javascript" src="${pageContext.request.contextPath }/js/h-ui.admin/jquery.validation/1.14.0/jquery.validate.js"></script> 
<script type="text/javascript" src="${pageContext.request.contextPath }/js/h-ui.admin/jquery.validation/1.14.0/validate-methods.js"></script> 
<script type="text/javascript" src="${pageContext.request.contextPath }/js/h-ui.admin/jquery.validation/1.14.0/messages_zh.js"></script> 

<title>添加车辆位置信息 </title>

<%@ taglib uri="/dfhc" prefix="dfhc" %>
</head>
<body>


<article class="page-container">
<div  style="z-index:9999;display:none;" id="organizationContent">
	<div class="zTreeDemoBackground" >
		<ul id="treeDemo" class="ztree"  ></ul>
	</div>
</div>
	<form action="" method="post" class="form form-horizontal" id="form-carposition-add">
	   <input type="hidden" id="id" name="id" value="${bean.id}">
							
							
	    <dfhc:div templateId="h_ui_div_row_cl">
	    <dfhc:title templateId="h_ui_label_title"><dfhc:span templateId="h_ui_not_null_span"></dfhc:span><%=ICarPositionConstants.TABLE_COLUMN_DISPLAY.get("carId")%>：</dfhc:title>	    
	    <dfhc:div templateId="h_ui_div_fromcontrol">	        
			<dfhc:input templateId="h_ui_input" value="${bean.carId}" placeholder="" id="carId" name="carId"/>			
	    </dfhc:div>	    		 
	  </dfhc:div>
							
	    <dfhc:div templateId="h_ui_div_row_cl">
	    <dfhc:title templateId="h_ui_label_title"><dfhc:span templateId="h_ui_not_null_span"></dfhc:span><%=ICarPositionConstants.TABLE_COLUMN_DISPLAY.get("posLongitude")%>：</dfhc:title>	    
	    <dfhc:div templateId="h_ui_div_fromcontrol">	        
			<dfhc:input templateId="h_ui_input" value="${bean.posLongitude}" placeholder="" id="posLongitude" name="posLongitude"/>			
	    </dfhc:div>	    		 
	  </dfhc:div>
							
	    <dfhc:div templateId="h_ui_div_row_cl">
	    <dfhc:title templateId="h_ui_label_title"><dfhc:span templateId="h_ui_not_null_span"></dfhc:span><%=ICarPositionConstants.TABLE_COLUMN_DISPLAY.get("posLatitude")%>：</dfhc:title>	    
	    <dfhc:div templateId="h_ui_div_fromcontrol">	        
			<dfhc:input templateId="h_ui_input" value="${bean.posLatitude}" placeholder="" id="posLatitude" name="posLatitude"/>			
	    </dfhc:div>	    		 
	  </dfhc:div>
							
	    <dfhc:div templateId="h_ui_div_row_cl">
	    <dfhc:title templateId="h_ui_label_title"><dfhc:span templateId="h_ui_not_null_span"></dfhc:span><%=ICarPositionConstants.TABLE_COLUMN_DISPLAY.get("currTime")%>：</dfhc:title>	    
            <dfhc:div templateId="h_ui_div_fromcontrol">	        
			<dfhc:input templateId="h_ui_date_input" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" id="currTime" name="currTime"/>
	    </dfhc:div>	    		 
	  </dfhc:div>
							
	    <dfhc:div templateId="h_ui_div_row_cl">
	    <dfhc:title templateId="h_ui_label_title"><dfhc:span templateId="h_ui_not_null_span"></dfhc:span><%=ICarPositionConstants.TABLE_COLUMN_DISPLAY.get("speed")%>：</dfhc:title>	    
	    <dfhc:div templateId="h_ui_div_fromcontrol">	        
			<dfhc:input templateId="h_ui_input" value="${bean.speed}" placeholder="" id="speed" name="speed"/>			
	    </dfhc:div>	    		 
	  </dfhc:div>
							
	    <dfhc:div templateId="h_ui_div_row_cl">
	    <dfhc:title templateId="h_ui_label_title"><%=ICarPositionConstants.TABLE_COLUMN_DISPLAY.get("taskId")%>：</dfhc:title>	    
	    <dfhc:div templateId="h_ui_div_fromcontrol">	        
			<dfhc:input templateId="h_ui_input" value="${bean.taskId}" placeholder="" id="taskId" name="taskId"/>			
	    </dfhc:div>	    		 
	  </dfhc:div>
							
	    <dfhc:div templateId="h_ui_div_row_cl">
	    <dfhc:title templateId="h_ui_label_title"><dfhc:span templateId="h_ui_not_null_span"></dfhc:span><%=ICarPositionConstants.TABLE_COLUMN_DISPLAY.get("directionType")%>：</dfhc:title>	    
			<dfhc:div templateId="h_ui_div_fromcontrol">
				<dfhc:select templateId="h_ui_select" size="1" name="directionType" id="directionType" pleaseSelect="1" defaultValue="${bean.directionType}" sqlOption="code" code="DIRECTION_TYPE" />				
			</dfhc:div>
	  </dfhc:div>
		<dfhc:div templateId="h_ui_div_row_cl">
			<dfhc:div templateId="h_ui_div_pop_up_button">
				<dfhc:button templateId="h_ui_submit_button" />
			</dfhc:div>
		</dfhc:div>
	</form>
</article>



<script type="text/javascript">
$(function(){
	//获取新id
	<c:if test="${empty bean}"> 
	$('#id').val(getNewId('<%=ICarPositionConstants.TABLE_NAME%>'));
	</c:if>
	$('.skin-minimal input').iCheck({
		checkboxClass: 'icheckbox-blue',
		radioClass: 'iradio-blue',
		increaseArea: '20%'
	});
	
	$("#form-carposition-add").validate({
		rules:{
			posLongitude:{			
				required:true,
				minlength:1,
				maxlength:9
			},
			posLatitude:{			
				required:true,
				minlength:1,
				maxlength:9
			},
			currTime:{			
				required:true,
				minlength:1,
			},
			speed:{			
				required:true,
				minlength:1,
				maxlength:5
			},
			directionType:{			
				required:true,
				minlength:1,
				maxlength:1
			}
		},
 		messages: {
			posLongitude:{
		        required: "请输入位置经度",
		        minlength: "位置经度至少由1个字母组成",
		        maxlength: "位置经度最大长度为9个字母"
	           },
			posLatitude:{
		        required: "请输入位置纬度",
		        minlength: "位置纬度至少由1个字母组成",
		        maxlength: "位置纬度最大长度为9个字母"
	           },
			currTime:{
		        required: "请输入日期时间",
		        minlength: "日期时间至少由1个字母组成",
	           },
			speed:{
		        required: "请输入速度",
		        minlength: "速度至少由1个字母组成",
		        maxlength: "速度最大长度为5个字母"
	           },
			directionType:{
		        required: "请输入方向类型",
		        minlength: "方向类型至少由1个字母组成",
		        maxlength: "方向类型最大长度为1个字母"
	           }
	    },		
		onkeyup:false,
		focusCleanup:true,
		success:"valid",
		submitHandler:function(form){
			<c:if test="${empty bean}"> 
			var url = getRootPath()+"/carposition/insert?jsguid="+$('#id').val();
			</c:if>
			<c:if test="${not empty bean}"> 
			var url = getRootPath()+"/carposition/update?jsguid="+$('#id').val();
			</c:if>
			//提交成功关闭
			submitAjax(url,$("#form-carposition-add").serialize()); 		    		    		
			layer_close();			
		}
	});
});
</script> 
<!--/请在上方写此页面业务相关的脚本-->
</body>
</html>
